import math

c = [[2, 1, 1], [6, 1, 4, 1], [8, 1, 3, 3, 1], [90, 7, 32, 12, 32, 7],
     [288, 19, 75, 50, 50, 75, 19], [840, 41, 216, 27, 272, 27, 216, 41],
     [17280, 751, 3577, 1323, 2989, 2989, 1323, 3577, 751]]


def f(x):
    return math.sin(x) / x


def cal(n, a, b):
    sum = 0
    for i in range(n + 1):
        x = c[n - 1][i + 1]
        sum += x * f(i)
    sum /= c[n - 1][0] * (b - a)
    return sum


def integral():
    a, b = input("请输入积分边界:").split(",")
    n = int(input("请输入积分节点个数:"))
    res = cal(n, float(a), float(b))
    print("积分结果为:", res)


if __name__ == '__main__':
    integral()
